<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>krypton</title>
  <link rel="stylesheet" href="/public/lib/krypton.css" media="all">
</head>
<body>

<div style="margin-top: 400px" id="kaptcha"></div>
<input type="button" id="submit_btn" value="提交"/>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script src="/sliding/krypton.js"></script>
<script type="text/javascript">
  var krypton = new Krypton('kaptcha');

  $("#submit_btn").click(function () {
    var obj = krypton.validateVal();
    if (obj.success) {
      $.post("/sliding/check", obj, function (resp) {
        console.log(resp)
        if (resp.success) {
          alert("success");
        } else {
          alert(resp.message);
        }
      });
    } else {
      alert("请先通过滑动验证");
    }
  });
</script>
</body>
</html>